<?php

class Ext_Attachment_Image_Show
{
    public $imageId;
    public $attachmentImageId;
    public $title;
    public $description;
    public $photo;
    
    public function __construct($attachmentImageId)
    {
        $this->photo = new Ext_Image_Show();
        $this->_build($attachmentImageId);
    }

    private function _build($attachmentImageId)
    {
        $this->attachmentImageId = $attachmentImageId;

        $image = App_Model_DbTable_Attachment_Image::getInstance()->getRowById($attachmentImageId);

        if(isset($image['imageId'])){
            $this->imageId = $image['imageId'];
            $this->photo->build($this->imageId);
        }

        if(isset($image['title'])){
            $this->title = $image['title'];
        }
        
        if(isset($image['description'])){
            $this->description = $image['description'];
        }
    }
}


